﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

public partial class Pages_News : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            StringBuilder str = new StringBuilder();
            IList<News> list = new News().List(1, 4, 0, 1);
            str.Append("<label class='pink'>News</label>");
            foreach (News item in list)
            {
                str.AppendFormat(_format, item.Thumbnail, item.Title, item.Description, item.Id);
            }
            divList.InnerHtml = str.ToString();
        }
    }

    string _format = @"<div class='introduce'>
            <div class='img_large'>
                <img src='{0}' width='227' height='151' /></div>
            <label class='text_pink'>
                {1}</label><br />
            <br />
            <p class='text_des'>
                {2}</p>
            <div class='readmore'>
                read more {3}</div>
        </div>";
}